const mysql = require('mysql2/promise')
const config = require('./config')

async function showTableStructure () {
  try {
    const connection = await mysql.createConnection({
      host: config.database.host,
      user: config.database.user,
      password: config.database.password,
      database: config.database.name
    })

    console.log('📋 小说表结构:')
    const [rows] = await connection.query('DESCRIBE novels')
    console.table(rows)

    await connection.end()
  } catch (error) {
    console.error('❌ 查询失败:', error.message)
  }
}

showTableStructure()
